package com.zbkj.crmeb.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 直邮类型
 * @Description:
 * @author daigb
 * @date 2021-02-01
 */
public enum DirectMailTypeEnum implements IEnum<Integer> {

    CN(1, "直邮大陆"),
    HK(2, "直邮香港");

    private Integer code;
    private String msg;

    public static DirectMailTypeEnum valueOf(Integer code) {
        for (DirectMailTypeEnum value : values()) {
            if (value.getCode() == code) {
                return value;
            }
        }

        return null;
    }

    DirectMailTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}
